/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.promotion;

import com.enation.app.javashop.core.client.feignimpl.promotion.FullDiscountClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.enation.app.javashop.model.promotion.fulldiscount.dos.FullDiscountDO;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author zs
 * @version v2.0
 * @Description: 满赠断路器
 * @date 2020/4/16 14:38
 * @since v7.2.0
 */
@Component
public class FullDiscountClientFallbackFactory extends BaseFallbackFactory<FullDiscountClientFeignImpl> implements FallbackFactory {


    @Override
    protected FullDiscountClientFeignImpl fallback() {
        return new FullDiscountClientFallback();
    }

    /**
     * @author zs
     * @version v2.0
     * @Description: 满赠断路器
     * @date 2020/4/16 14:38
     * @since v7.2.0
     */
    @Component
    public static class FullDiscountClientFallback implements FullDiscountClientFeignImpl {

        protected final Logger logger = LoggerFactory.getLogger(this.getClass());

        @Override
        public FullDiscountDO getModel(Long id) {
            logger.error("满赠服务异常，getModel");
            return null;
        }
    }
}
